package com.config.dto;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author Jason
 * @date 2022年06月13日 下午9:15
 */
@Data
@ApiModel(value = "通用分页请求表单")
public class PageRequest {
    @ApiModelProperty(value = "页码",required = true,example = "1")
    private Integer pageNo = 1;

    @ApiModelProperty(value = "页容量",required = true,example = "20")
    private Integer pageSize = 20;
    @ApiModelProperty(hidden = true,value = "是否需要查询总条数")
    private Boolean searchCount = true;

    public Page of(){
        return new Page(getPageNo(), getPageSize(), getSearchCount());
    }

}
